package org.example.erp.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;

/**
 * 供应商管理表
 * @TableName supplier
 */
@TableName(value ="supplier")
@Data
public class Supplier implements Serializable {
    /**
     * 供应商编号
     */
    @TableId(type = IdType.AUTO)
    private Integer supplierId;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 供应商名称
     */
    private String supplierName;

    /**
     * 供应商简称
     */
    private String supplierAbbreviation;

    /**
     * 供应商等级
     */
    private String supplierGrade;

    /**
     * 供应商评分
     */
    private BigDecimal supplierScore;

    /**
     * 供应商电话
     */
    private String supplierPhone;

    /**
     * 供应商地址
     */
    private String supplierAddress;

    /**
     * 状态（是否启用）
     */
    private Integer status;

    /**
     * 供应商官网地址
     */
    private String officialAddress;

    /**
     * 邮箱地址
     */
    private String emailAddress;

    /**
     * 供应商简介
     */
    private String supplierIntroduction;

    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Supplier other = (Supplier) that;
        return (this.getSupplierId() == null ? other.getSupplierId() == null : this.getSupplierId().equals(other.getSupplierId()))
            && (this.getSupplierCode() == null ? other.getSupplierCode() == null : this.getSupplierCode().equals(other.getSupplierCode()))
            && (this.getSupplierName() == null ? other.getSupplierName() == null : this.getSupplierName().equals(other.getSupplierName()))
            && (this.getSupplierAbbreviation() == null ? other.getSupplierAbbreviation() == null : this.getSupplierAbbreviation().equals(other.getSupplierAbbreviation()))
            && (this.getSupplierGrade() == null ? other.getSupplierGrade() == null : this.getSupplierGrade().equals(other.getSupplierGrade()))
            && (this.getSupplierScore() == null ? other.getSupplierScore() == null : this.getSupplierScore().equals(other.getSupplierScore()))
            && (this.getSupplierPhone() == null ? other.getSupplierPhone() == null : this.getSupplierPhone().equals(other.getSupplierPhone()))
            && (this.getSupplierAddress() == null ? other.getSupplierAddress() == null : this.getSupplierAddress().equals(other.getSupplierAddress()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getOfficialAddress() == null ? other.getOfficialAddress() == null : this.getOfficialAddress().equals(other.getOfficialAddress()))
            && (this.getEmailAddress() == null ? other.getEmailAddress() == null : this.getEmailAddress().equals(other.getEmailAddress()))
            && (this.getSupplierIntroduction() == null ? other.getSupplierIntroduction() == null : this.getSupplierIntroduction().equals(other.getSupplierIntroduction()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSupplierId() == null) ? 0 : getSupplierId().hashCode());
        result = prime * result + ((getSupplierCode() == null) ? 0 : getSupplierCode().hashCode());
        result = prime * result + ((getSupplierName() == null) ? 0 : getSupplierName().hashCode());
        result = prime * result + ((getSupplierAbbreviation() == null) ? 0 : getSupplierAbbreviation().hashCode());
        result = prime * result + ((getSupplierGrade() == null) ? 0 : getSupplierGrade().hashCode());
        result = prime * result + ((getSupplierScore() == null) ? 0 : getSupplierScore().hashCode());
        result = prime * result + ((getSupplierPhone() == null) ? 0 : getSupplierPhone().hashCode());
        result = prime * result + ((getSupplierAddress() == null) ? 0 : getSupplierAddress().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getOfficialAddress() == null) ? 0 : getOfficialAddress().hashCode());
        result = prime * result + ((getEmailAddress() == null) ? 0 : getEmailAddress().hashCode());
        result = prime * result + ((getSupplierIntroduction() == null) ? 0 : getSupplierIntroduction().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", supplierId=").append(supplierId);
        sb.append(", supplierCode=").append(supplierCode);
        sb.append(", supplierName=").append(supplierName);
        sb.append(", supplierAbbreviation=").append(supplierAbbreviation);
        sb.append(", supplierGrade=").append(supplierGrade);
        sb.append(", supplierScore=").append(supplierScore);
        sb.append(", supplierPhone=").append(supplierPhone);
        sb.append(", supplierAddress=").append(supplierAddress);
        sb.append(", status=").append(status);
        sb.append(", officialAddress=").append(officialAddress);
        sb.append(", emailAddress=").append(emailAddress);
        sb.append(", supplierIntroduction=").append(supplierIntroduction);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}